#include "QMLInterface.h"
//#include "Scene.h"
#include <QDebug>
#include <QMap>
#include <QString>

#include <QUrl>
#include <QProcess>
#include "SysConfig.h"
#include "MainService.h"

QMLInterface::QMLInterface()
{
}

QMLInterface *QMLInterface::instance()
{
    static QMLInterface app;
    return &app;
}

void QMLInterface::slotShowLandmarks()
{
	MainService::instance()->showLandMarks();
}

void QMLInterface::slotShowNightBuildings()
{
	MainService::instance()->showMidBuildings();
}

void QMLInterface::slotShowCyberThreat()
{
	MainService::instance()->showCyberThreat();
}

void QMLInterface::slotSetCyberThreatType(int i)
{
	MainService::instance()->setCyberThreatType(i);
}

void QMLInterface::slotSetCyberThreatFilter(QString str)
{
	MainService::instance()->setCyberThreatFilter(str);
}

void QMLInterface::slotShowWebView()
{

}

void QMLInterface::slotShowDatabaseView()
{
}

QString QMLInterface::slotGetUrl(QString key)
{
	QMap<QString, QString> urllist;
	if (urllist.size() < 1) {
		urllist.insert("CyberThreatWidgetList", QString::fromStdString(SysConfig::intance()->url_CyberThreatWidgetList));
		urllist.insert("CyberThreatWidgetChart", QString::fromStdString(SysConfig::intance()->url_CyberThreatWidgetChart));
	}
	if (urllist.contains(key)) {
		return urllist.value(key);
	}
	return "";
}

